#include<stdio.h>
#include<stdlib.h>

#define ROWS 3
#define COLS 5
int count = 0;
int main()
{
	int** arr = (int**)malloc(sizeof(int*) * ROWS);

	for (int i = 0; i < ROWS; ++i)
	{
		arr[i] = malloc(sizeof(int) * COLS);
	}

	for (int i = 0; i < ROWS; ++i)
	{
		for (int j = 0; j < COLS; ++j)
		{
			arr[i][j] = count++;
		}
	}

	for (int i = 0; i < ROWS; ++i)
	{
		for (int j = 0; j < COLS; ++j)
		{
			printf("%d ",	arr[i][j] );
		}
		printf("\n");
	}
}